#ifndef __TASKQUEUE_H_
#define __TASKQUEUE_H_

#include "Noncopyable.hpp"
#include "Condition.hpp"
#include "MutexLock.hpp"
#include <queue>

using std::queue;
using std::size_t;

namespace pc{

class TaskQueue
:Noncopyable
{
public:
    TaskQueue(size_t);
    ~TaskQueue();
    bool empty() const;
    bool full() const;
    void push(int);
    int pop();

private:
    queue<int> _que;
    size_t     _queSize;
    MutexLock  _mutex;
    Condition  _notFull;
    Condition  _notEmpty;
};

}//end of namespace pc

#endif

